<?php

/**
 * @file
 * Default simple view template to display a list of rows.
 *
 * @ingroup views_templates
 */
?>
<?php if (!empty($title)): ?>
  <h3><?php print $title; ?></h3>
<?php endif; ?>

<?php
    $index=0;
    foreach ($rows as $id => $element){

        $col=$index%4;
        $row=floor($index/4);

        if ($classes_array[$id]) { print '<div class="' . $classes_array[$id] .' row-'.$row.' col-'.$col.'" col="'.$col.'" row="'.$row.'">';  }
          print $element;
        print '</div>';
          $index++;

    }
?>